Skip to content

Refactor product/portal schema#197

Draft
tomschr wants to merge 1 commit intomainfrom
toms/187-product-schema
Draft

Refactor product/portal schema#197
tomschr wants to merge 1 commit intomainfrom
toms/187-product-schema

Conversation

@tomschr
Copy link
Copy Markdown
Contributor

@tomschr tomschr commented Mar 4, 2026

The portal schema (formerly Docserv product schema) got some updates.

General Changes

These changes reflect broad architectural shifts and naming conventions throughout the entire configuration system.

  • Rebranding: The naming convention has shifted from "Docserv²" to "Portal."

  • Enhanced Modularity: The schema now explicitly supports splitting large configuration files into smaller, more manageable parts. By utilizing inclusion mechanisms, you can maintain different sections of the portal (like <categories> or specific products) in separate files, leading to a cleaner and more maintainable structure.

  • Documentation-First Design: The schema now heavily utilizes db:refname and db:refpurpose annotations for almost every element and attribute. This allows for automated generation of human-readable documentation directly from the RNC file.

  • Implicit Language Logic: Master/source language identification has shifted from a boolean attribute (@default) to a value-based system. The schema now assumes en-us is the default language for products and deliverables.

  • Migration Tooling: To facilitate the transition, an XSLT migration stylesheet is available. This tool automates the conversion of version 6.0 configuration files to the 7.0 format, handling the renaming of elements, restructuring of attributes, and the removal of deprecated metadata.

  • Resolving Ambiguity: Some elements were used in multiple contexts, for example, the multipurpose <language> element. The new portal schema resolves this ambiguity.

New Elements and Attributes

Version 7.0 introduces several elements to support a more hierarchical portal structure and better metadata documentation.

Elements

  • <portal>: The new root element for the entire portal configuration.
  • <spotlight>: Used to highlight specific products or deliverables on the entry page.
  • <productfamilies>: A container for defining product family groupings.
  • <series>: Defines series/tabs (e.g., SBP, TRD, Products & Solutions).
  • <item>: Generic element for entries within a family or series.
  • <descriptions>: A unified wrapper for product or version descriptions.
  • <categories>: A wrapper for grouping category definitions.
  • <resources>: Replaces the old builddocs logic for defining deliverables.
  • <prebuilt>: Specifically for defining pre-built content links with metadata.
  • <xi:include>: An XInclude element pointing to an external XML resource to facilitate modularity.

Attributes

  • @schemaversion: Replaces the previous versioning logic for stricter validation against the 7.0 spec.
  • @rank: Determines the sorting order of products on the portal homepage.
  • @family: Links a product to a specific product family via IDREF.
  • @series: Links a product to a specific series/tab via IDREF.
  • @path: Used on products and docsets to specify relative directory names.
  • @linkend: Used in <ref\> elements to point to external link identifiers.
  • @treatment: Defines how version-specific descriptions interact with global ones (append, prepend, or replace).

Renamed Elements and Attributes

Many elements were renamed to move away from "Docserv²" terminology and adopt a cleaner "Portal" naming convention.

Old Name (v6.0) New Name (v7.0) Context
<desc> <descriptions> Move a single description into a parent <descriptions>
<builddocs> <resources> Container for definitions of resources
<overridedesc> <descriptions> Version-specific content
<language> (in resources) <locale> Regional build definitions
@productid @id Unique identifier for products
@setid @id Unique identifier for docsets
@categoryid @id Unique identifier for categories
@linkid @id Unique identifier for external links

Removed Elements and Attributes

The following items were deprecated or removed to simplify the build process and clean up the configuration.

  • <buildcontainer>: Support for specifying custom Docker images per version has been removed.
  • <param>: Support for custom XSLT parameters via the config file is removed.
  • @translation-type: The distinction between "list" and "full" translations has been replaced by a more flexible <locale> and reference model.
  • @default: This attribute (previously used in <desc> and <language> to flag the source/master language) has been removed. Language master ship is now determined by the explicit en-us value in the @lang attribute.
  • @meta from <deliverable>

Changed Content Models

The structure of the schema has evolved to be more modular and better documented.

Modularization (XInclude)

Major elements now support xi:include, allowing configuration files to be broken into smaller, manageable chunks.

link

Allows multiple URLs in <link>. This makes it possible to have different formats. Additionally allow a <desc> element to describe the resource.

The minimum structure is this:

<external>
    <link category="about" gated="false">
      <!-- Cardinality for <url>: one or more -->
      <url href="http://example.com" format="html"/>
      <descriptions>
    <desc lang="en-us">
      <title></title>
    </desc>
    <!-- more <desc> for other languages -->
      </descriptions>
    </link>
</external>

Deliverable References

In version 7.0, translations of deliverables are primarily handled as references (<ref\>) back to the source DC file in the en-us locale, rather than duplicating the full deliverable metadata.

Additionally, the <ref/> contains only a @linkend attribute to link to a resource. You don't need dc, product, or other strange combinations anymore.

Expanded Root Element Support

The schema no longer restricts the start of a document to just a product definition. It now allows for much more variety in valid root elements, supporting the standalone definition of <product>s, <docset>s, <categories>, and more.

Simplified External Link Model

The model for external links has been significantly flattened. The previous hierarchical structure involving nested <language> elements has been removed. Now, a <link> directly contains a list of <url> elements and a unified <descriptions> block, simplifying how external resources are defined across different locales.

References

@tomschr tomschr self-assigned this Mar 4, 2026
@tomschr tomschr added the kind:refactor Code cleanup without logic change. label Mar 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

Coverage Report

For commit c8f3e94

Click to expand Coverage Report
  Name                                           Stmts   Miss Branch BrPart  Cover
  --------------------------------------------------------------------------------
+ src/docbuild/models/deliverable.py               180      1     22      0  99.5%
+ src/docbuild/cli/cmd_check/process.py             58      0     22      1  98.8%
+ src/docbuild/models/manifest.py                  111      1     12      1  98.4%
+ src/docbuild/utils/pidlock.py                     79      1     14      1  97.8%
+ src/docbuild/cli/cmd_cli.py                       96      1     10      2  97.2%
+ src/docbuild/cli/cmd_validate/process.py         178      5     52      4  96.1%
+ src/docbuild/cli/callback.py                      35      0     10      2  95.6%
+ src/docbuild/utils/concurrency.py                 69      3     18      1  95.4%
- src/docbuild/cli/cmd_config/__init__.py            9      1      0      0  88.9%
- src/docbuild/config/xml/stitch.py                 47      5     12      0  88.1%
- src/docbuild/cli/cmd_metadata/metaprocess.py     215     26     66     13  82.6%
- src/docbuild/cli/cmd_check/__init__.py            18      5      2      0  65.0%
- src/docbuild/cli/cmd_build/__init__.py            13      5      0      0  61.5%
- src/docbuild/cli/cmd_metadata/__init__.py         27     10      2      0  58.6%
- src/docbuild/cli/cmd_config/environment.py        11      6      2      0  38.5%
  --------------------------------------------------------------------------------
+ TOTAL                                           2992     70    706     25  96.9%
  
  46 files skipped due to complete coverage.

@tomschr tomschr force-pushed the toms/187-product-schema branch from c891db7 to 24c830c Compare March 16, 2026 16:31
These changes reflect broad architectural shifts and naming conventions
throughout the entire configuration system.

* **Rebranding**: The naming convention has shifted from Docserv to Portal.
  This is reflected in namespace changes and element renaming
  (e.g., `<product>` is now part of a portal root).

* **Documentation-First Design**: The schema now heavily utilizes `db:refname`
  and `db:refpurpose` annotations for almost every element and attribute.
  This allows for automated generation of human-readable documentation directly
  from the RNC file.

* *Enhanced Modularity**: The schema now explicitly supports splitting large
  configuration files into smaller, more manageable parts. By utilizing
  inclusion mechanisms, you can maintain different sections of the portal
  (like `<categories>` or specific products) in separate files, leading to
  a cleaner and more maintainable structure.

* **Implicit Language Logic**: Master/source language identification has shifted
  from a boolean attribute (`@default`) to a value-based system.
  The schema now assumes `en-us` is the source locale for products and deliverables.

* **Migration Tooling**: To facilitate the transition, an XSLT migration stylesheet
  is available. This tool automates the conversion of version 6.0 configuration
  files to the 7.0 format, handling the renaming of elements, restructuring of
  attributes, and the removal of deprecated metadata.

Version 7.0 introduces several elements to support a more hierarchical portal
structure and better metadata documentation.

* `<portal>`: The new root element for the entire portal configuration.
* `<spotlight>`: Used to highlight specific products or deliverables on
  the entry page.
* `<productfamilies>`: A container for defining product family groupings.
* `<series>`: Defines series/tabs (e.g., SBP, TRD, Products & Solutions).
* `<item>`: Generic element for entries within a family or series.
* `<descriptions>`: A unified wrapper for product or version descriptions.
* `<categories>`: A wrapper for grouping category definitions.
* `<resources>`: Replaces the old builddocs logic for defining deliverables.
* `<prebuilt>`: Specifically for defining pre-built content links with metadata.
* `<xi:include>`: An XInclude element pointing to an external XML resource
  to facilitate modularity.

* New elements
  * New `<portal>` element (root element of everything)
  * Add optional `<spotlight>` element
    The `linkend` attribute points to a specific product, docset, or deliverable.
    Two possible notations: with and without text (empty element).
  * Insert XInclude definition
    Disable specific attributes like `xpointer`, `fragid`, `language`, and
    `accept`.
  * Add `<productfamilies>` and `<series>` to portal
    Both contain an `<item id="..."> ... </item>`.
    Having text inside `<item>` makes it easier and we don't need an
    additional `name` attribute.

* Changed content models
  * The `start` pattern allows `<product>`, `<docset>`, `<categories>`,
    `<category>`, and `<descriptions>`.
  * Simplified `<link>`: Allows multiple URLs in `<link>`. This makes it
    possible to have different formats. Additionally allow a `<desc>`
    element to describe the resource.
  * Major elements now support `<xi:include>`, allowing configuration files
    to be broken into smaller, manageable chunks.
  * `<ref/>` contains only a `@linkend` attribute to link to a resource.
    You don't need `dc`, `product`, or some other strange combination.

* Renamed elements
  * `<desc>` -> `<descriptions>`
    Move <desc> elements into a parent <descriptions>
  * `<builddocs>` -> `<resources>`
    Container for definitions of resources
  * `<overridedesc>` -> `<descriptions>`
    Version-specific content
  * `<builddocs>/<language>` -> `<locale>`
    Require at least one <locale> with lang="en-us" as default language.

* Removed elements
  * Disable `<param>` in `<deliverable>`
  * Remove `<buildcontainer>` from `<builddocs>`
  * Remove ds.deliverablerestricted ds.subdeliverablerestricted

* New attributes
  * Add xml:base for all start elements
    This is needed when elements are xincluded they get
    automatically a xml:base attribute.
  * Add `family` and `series` for `<product>`
  * Add optional `rank` in `<product>`

* Changed attributes
  * Use xsd:language for ds.type.lang pattern
    The xsd:token isn't the right one.
  * Make schemaversion optional on <product>
  * Add datatypes library (xsd prefix)
  * Raise `schemaversion` value to `7.0`

* Renamed attributes
  * `productid`, `categoryid`, `setid`, `linkid` are all "id" now
    They are of type ID (not just token or string)

* Removed attributes
  * `meta` in deliverable
  * `default` in `<desc>`
    Use required lang="en-us" instead of default="true"
  * Remove double ds.titleformat.attr definition
@tomschr tomschr force-pushed the toms/187-product-schema branch from ba1fe36 to c8f3e94 Compare April 21, 2026 12:25
@tomschr tomschr mentioned this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:refactor Code cleanup without logic change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant